<?php

namespace app\admin\model;

use think\Db;
use think\Model;

class Keyword extends Model
{
    public function creat($data){
        // 启动事务
        Db::startTrans();
        $return=false;
        try {
            $list=Db::table('search')->insert($data);
            if($list){
                Db::commit();
                $return = true;
            }
        } catch (\Exception $e) {
            // 回滚事务
            Db::rollback();
        }
        return $return;
    }
}
